package com.sky.context;
import com.sky.entity.Employee;
import com.sky.entity.LoginInfo;

public class BaseContext {
    public static ThreadLocal<LoginInfo> threadLocal = new ThreadLocal<>();

    public static void setCurrentUser(LoginInfo loginInfo) {
        threadLocal.set(loginInfo);
    }

    public static Long getCurrentId() {
        return (Long) threadLocal.get().getId();
    }
    public static Integer getCurrentPermission() {
        return threadLocal.get().getPermission();
    }
    public static void removeCurrentId() {
        threadLocal.remove();
    }

}
